package com.gallery.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import entity.Images;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import vo.ImagesVO;

import java.util.List;

/**
 * @param
 * @return
 */
@Mapper
public interface ImagesMapper extends BaseMapper<Images> {
    @Select("SELECT * FROM images where status= '0'  ORDER BY RAND()  LIMIT 10  ")
    List<ImagesVO> randomImages();
    @Select("SELECT * FROM images where status= '0' and clazz =#{clazz} ORDER BY RAND()  LIMIT 10  ")
    List<ImagesVO> randomImagesForUser(String clazz);
}
